# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=clevis
pkgver=18
pkgrel=0
pkgdesc="Pluggable framework for automated decryption"
url="https://github.com/latchset/clevis"
license="GPL-3.0-or-later WITH OpenSSL-Exception"
arch="all !s390x !riscv64" # blocked by udisks2
depends="bash cryptsetup jose libpwquality"
makedepends="
	asciidoc
	bash-completion
	meson
	tpm2-tools
	cryptsetup-dev
	jansson-dev
	jose-dev
	audit-dev
	udisks2-dev
	luksmeta-dev
	"
checkdepends="jq tang"
subpackages="
	$pkgname-dbg
	$pkgname-doc
	$pkgname-bash-completion
	"
source="https://github.com/latchset/clevis/archive/v$pkgver/clevis-$pkgver.tar.gz
	musl.patch
	"

build() {
	abuild-meson . output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	meson test --no-rebuild -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
19b6743ff61ff7e29699bbc3fb69dfa31567a37ab824629330b57c92aa89b70759d63c1770be68d4525681ec9ba56d980cae2bb1cdeee6192992ede449a0e4ff  clevis-18.tar.gz
3ba68e896b58040eaddc50dcdf9fa9a42c0348be4bc9c96d09061563a608b9f77edf21cf159d45ccd95954625496cd3645acccaed8642b360f632201b9a28fd0  musl.patch
"
